home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pom230.zip / EXAMPLE4.POM < prev    next >
Text File  |  1993-01-03  |  3KB  |  70 lines

  1. ; The following comment lines are for quick-reference.
  2. ; Copy them into your own POM files to make programming easier.
  3. ;
  4. ; COMMAND FORMATS                              EXAMPLES
  5. ; ---------------                              --------
  6. ; MINLEN  number                               MINLEN  "15"
  7. ; SET     var1 value1                          SET     NAME $FLINE[20 26]
  8. ; IGNORE  value1 value2                        IGNORE  PRICE "0.00"
  9. ; ACCEPT  value1 value2                        ACCEPT  $FLINE[1 3] "YES"
  10. ; IF      value1 value2 var1 value3 [value4]   IF      PRICE "0.00" BONUS "1.00"
  11. ; TRIM    var1 spec1 character                 TRIM    PRICE "R" "$"
  12. ; PAD     var1 spec1 character len             PAD     SERIALNUM "L" "0" "10"
  13. ; INSERT  var1 spec1 value1                    INSERT  PRICE "L" "$"
  14. ; CHANGE  var1 value1 value2                   CHANGE  DATE "/" "--"
  15. ; OUT     value1 value2 |output-picture        OUT     "X" "X" |{PRICE}
  16. ; OUTEND  value1 value2 |output-picture        OUTEND  "X" "X" |{$FLINE}
  17. ;
  18. ; PADDING FOR CLARITY
  19. ; -------------------
  20. ;
  21. ; Before:   IF PRICE "0.00" BONUS "1.00" "0.00"
  22. ; After:    IF PRICE = "0.00" THEN BONUS = "1.00" ELSE "0.00"
  23. ;
  24. ;-------------------------------------------------------------------------------
  25. ;
  26. ;  Restrict the lines we'll accept
  27. ;
  28. ACCEPT $FLINE[58 60] = "IBM"
  29. ACCEPT $FLINE[58 60] = "MAC"
  30. ;
  31. ;  Pad out description, with spaces, to 40 characters
  32. ;  We'll also modify the string -PC to read -IBMPC
  33. ;    Note the trailing space after PC to ensure it's at the end of the string
  34. ;
  35. SET    descrip       = $FLINE[19 49]
  36. INSERT descrip         "@PC " "IBM"
  37. PAD    descrip         "R"   " "   "40"
  38. ;
  39. ;  Make quantity only 2 characters wide (maximum would therefore be 99)
  40. ;
  41. SET    qty           = $FLINE[63 66]
  42. TRIM   qty             "A"   " "
  43. PAD    qty             "L"   " "  "2"
  44. ;
  45. ;  Take only the last three digits of the invoice number
  46. ;
  47. SET    inv           = $FLINE[14 16]
  48. ;
  49. ;  Detect minus sign and set price accordingly
  50. ;
  51. SET    price         = $FLINE[70 76]
  52. TRIM   price           "A" " "
  53. IF     $FLINE[77]    = "-" THEN minus = "-" ELSE ""
  54. INSERT price           "L" minus
  55. PAD    price           "L" " " "7"
  56. INSERT price           "L" "$"
  57. ;
  58. ;  Set other fields; note use of uppercase for type
  59. ;
  60. SET    itemnum       = $FLINE[01 07]
  61. SET    type          = $FLUPC[51 55]
  62. SET    cat           = $FLINE[58 60]
  63. ;
  64. ;  Set output as follows:
  65. ;  Invoice, Item, Type (in uppercase), Category
  66. ;  Description, Quantity, Unit price
  67. ;
  68. OUT    "" "" |{inv} {itemnum} {type} {cat}
  69. OUTEND "" "" | {descrip} {qty}    {price}
  70.